package com.hai.service.impl;

import com.hai.entity.Menu;
import com.hai.mapper.MenuMapper;
import com.hai.service.MenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.hai.utils.MenuTreeBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * <p>
 * 菜单表 服务实现类
 * </p>
 *
 * @author NieChangan
 * @since 2022-05-21
 */
@Service
public class MenuServiceImp extends ServiceImpl<MenuMapper, Menu> implements MenuService {



    @Override
    public List<Menu> findMenuTree() {
        //查询所有列表
        List<Menu> menus = this.baseMapper.selectList(null);

        return MenuTreeBuilder.build(menus);
    }



    @Override
    public List<Long> findOpenIds() {
        return null;
    }
}
